package com.jsjvm.shared.vmcmds;

/**
 * Commands that are given by the front-end. Arguments are given uninterpreted
 * as a byte array.
 * 
 * @author ctalau
 *
 */
public class VMCommand {
	public static enum VMCommandType{
		ARRAY_LENGTH,
		ARRAY_GET_VALUES,
		ARRAY_SET_VALUES,
		ARRAY_NEW,
		
		GET_VISIBLE_CLASSES,
		GET_ALL_CLASSES,
		
		CLASS_GET_SUPER,
		CLASS_SET_VALUES,
		CLASS_INVOKE_METHOD,
		CLASS_NEW_INSTANCE,
		
		EVENT_SET,
		EVENT_CLEAR,
		
		METHOD_GET_LINE_TABLE,
		METHOD_GET_VARIABLE_TABLE,
		
		OBJECT_GET_VALUES,
		OBJECT_SET_VALUES,
		OBJECT_INVOKE_METHOD,
		OBJECT_CONTROL_COLLECTION,
		OBJECT_GET_CLASS,
		
		TYPE_SIGNATURE,
		TYPE_MODIFIERS,
		TYPE_FIELDS,
		TYPE_METHODS,
		TYPE_INNER_CLASSES,  // hard to get right
		TYPE_INTERFACES,
		TYPE_CLASS_OBJECT,	// self :)
		TYPE_STATUS,
		TYPE_VALUES,
		TYPE_SOURCE_FILE,
		TYPE_VERSION,
		
		FRAME_GET_VALUES,
		FRAME_SET_VALUES,
		FRAME_THIS_POINTER,
		FRAME_COUNT,
		FRAME_LOCATIONS,
		
		STRING_NEW_OBJECT,
		STRING_VALUE,
		
		THREAD_EXIT,
		THREAD_SUSPEND,
		THREAD_RESUME,
	}
	
	private VMCommandType type;
	private byte [] args;

	
	
	public VMCommand(VMCommandType type, byte[] args) {
		super();
		this.type = type;
		this.args = args;
	}
	
	
	public VMCommandType getType() {
		return type;
	}
	public byte [] getArgs() {
		return args;
	}
}


